home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-17 | 4.6 KB | 161 lines | [SGPA/SCPG] |
- on createJumpLines
- put 0 into n -- Count for Jump-Line stories.
-
- -- Find all the Stories & set thier fonts to THE_FONT
- -- Item 1 of name tells if it is a story. (Word 2 = Story Number)
- -- Item 2 of name tells what link order. (Word 2 = If it a title (Headline) ).
- -- item 3 of name tells what page it is on.
- set lockscreen to true
-
- put "unknown" into TheStories
- put 0 into TotalStories
-
- put "Times" into THE_FONT
- put 12 into THE_SIZE
- -- Find all unique stories.
- repeat with x = 1 to number of pages
- set currentpage to x
- Repeat with x = 1 to the number of objects
- set the itemdel to "\"
- if (Word 1 of name of object x = "Story") and ¬
- (word 2 of item 2 of name of object x ≠ "title") then -- Found a story!
- set the itemdel ","
-
- -- Check if we have this story already...
- put "No Match" into FindResult
- repeat with y = 1 to number of items in TheStories
- if name of object x = item y of TheStories then
- put "Match" into FindResult
- end if
- end repeat -- Found Match?
-
- if FindResult = "No Match" then
- put TotalStories + 1 into TotalStories
- put the name of object x into item TotalStories of TheStories
- end if
- put empty into FindResult
-
- end if
- end repeat -- Objects
- set the itemdel to ","
- end repeat -- Pages
- set the currentpage to 1
-
- -- Get the number of stories
- put 1 into NumberOfStories
- repeat with s = 1 to number of items in TheStories
- put item s of TheStories into TheCurrentStory
- set itemdel to "\"
- put word 2 of item 1 of TheCurrentStory into TheCount
- set itemdel to ","
- if theCount > NumberOfStories then put theCount into NumberOfStories
- end repeat
-
- -- Go thru all the stories.
- repeat with t = 1 to NumberOfStories
-
- --Collect the story chains together, in link order.
- put 0 into LinkCount
- put empty into theLinkStories
- repeat with c = 1 to Number Of items in TheStories
- put item c of TheStories into CurrentStory
- set itemdel to "\"
- put word 2 of item 1 of CurrentStory into TheCount
- set itemdel to ","
-
- if theCount = t then
- put linkCount+1 into LinkCount
- put CurrentStory into item LinkCount of TheLinkStories
- end if
- end repeat
-
- -- Does this story contain more than 1 link that crosses page boundaries?
- if LinkCount > 1 then
-
- -- Now go thru all the links, and find the breaks.
- put item 1 of theLinkStories into ThePrevStoryLinkObject
- repeat with s = 2 to LinkCount
- -- Get the page of the s'th story.
- put item s of theLinkStories into TheStoryLinkObject
- set itemdel to "\"
- put item 3 of thePrevStoryLinkObject into PrevStoryPage
- put item 3 of theStoryLinkObject into StoryPage
- set itemdel to ","
-
-
- if PrevStoryPage ≠ StoryPage then
- -- Create a jump-line objects.
- set currentpage to PrevStoryPage
- -- Get name of this story.
- put username of story (item 1 of storyloc of object thePrevStoryLinkObject)¬
- into theStoryName
-
- put the rect of object thePrevStoryLinkObject into RectOfPrevObj
-
- -- Create "Continued on Page" object.
- put n+1 into n
- put "Jump Line From Obj " & n into TheJumpObj
- open story TheJumpObj
- -- Calc rect of prev object.
-
- put item 1 of RectOfPrevObj into pLeft
- put item 2 of RectOfPrevObj into pTop
- put item 3 of RectOfPrevObj into pRight
- put item 4 of RectOfPrevObj into pBottom
- --put pLeft + ((pRight - pLeft)/2) into pLeft -- Draw from center.
- put pBottom - .36 into pTop -- Draw from bottom.
-
- draw rectangle from pLeft,pTop to pRight,pBottom
- -- Set text offsets
- close story
- -- Enter text into obj.
- put quote & theStoryName & quote & " continued on page " & StoryPage into ¬
- story TheJumpObj
- set textwrap of last object to 0 aRoundRect
- set linePattern of last object to 0
- select all text in story theJumpObj
- set RulerJustification to right
- set textface to italic
- set textsize to 8
-
- -- Create "Cont'd From Page" object.
- set currentpage to StoryPage
- put the rect of object theStoryLinkObject into RectOfObj
- put "Jump Line To Obj " & n into TheJumpObj
- open story TheJumpObj
- -- Calc rect of prev object.
- put item 1 of RectOfObj into pLeft
- put item 2 of RectOfObj into pTop
- put item 3 of RectOfObj into pRight
- put item 4 of RectOfObj into pBottom
-
- --put pRight - ((pRight - pLeft)/2) into pRight
- put pTop + .36 into pBottom
-
- draw rectangle from pLeft,pTop to pRight,pBottom
- -- set text offsets
- close story
- put quote & theStoryName & quote & " continued from page " & PrevStoryPage into¬
- story TheJumpObj
- --select all text of story TheJumpObj
- --set textstyle to italic -- x here
- set textWrap of last object to 0 aRoundRect
- set linePattern of last object to 0
- select all text in story theJumpObj
- set RulerJustification to left
- set textface to italic
- set textsize to 8
-
- end if -- PrevPage ≠ StoryPage?
-
- put TheStoryLinkObject into ThePrevStoryLinkObject
-
- end repeat -- 2 to TotalStories.
- end if -- Totalstories > 1?
-
- set currentpage to 1
- end repeat
-
-
- end createJumpLines